// 导入路由
import { createRouter, createWebHashHistory } from "vue-router";
import Home from "../components/loading.vue";
import { navDate } from "@/untils/nav.js";

const routes = [
    {
        //路径 组件名 组件
        Path: '/',
        name: 'Home',
        component: Home,
    }
]

navDate.forEach((e) => {
    routes.push({
        path: e.path,
        name: e.name,
        component: () => import("@/" + e.component)
    })
})

// 创建路由
const router = createRouter({
    history: createWebHashHistory(),
    routes
})

// 导出路由
export default router;